/*
 * Copyright 2009 Brian Mackay brianwmackay@msn.com
 *   All Rights Reserved. See end of file
 */
package com.bmackay.vonsteuben.ontology.triples;

import com.bmackay.vonsteuben.ontology.VonSteuben;
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.vocabulary.RDF;

public class VonSteubenTriples {

    public static Triple[] createJob(String driver, String name) {
        return createJob(Node.createAnon(), driver, name);
    }

    public static Triple[] createJob(Node subject, String driver, String name) {
        Triple[] triples = new Triple[3];
        triples[0] = VonSteubenTriples.hasDriver(subject, Node.createLiteral(driver));
        triples[1] = VonSteubenTriples.hasName(subject, Node.createLiteral(name));
        triples[2] = VonSteubenTriples.job(subject);
        return triples;
    }

    public static Triple hasDriver(Node subject) {
        return hasDriver(subject, Node.ANY);
    }

    public static Triple hasDriver(Node subject, Node object) {
        return Triple.create(subject, VonSteuben.hasDriver.asNode(), object);
    }

    public static Triple hasName(Node subject, Node object) {
        return Triple.create(subject, VonSteuben.hasName.asNode(), object);
    }

    public static Triple hasURI(Node subject) {
        return hasURI(subject, Node.ANY);
    }

    public static Triple hasURI(Node subject, Node object) {
        return Triple.create(subject, VonSteuben.hasURI.asNode(), object);
    }

    public static Triple hasAdditionalConfiguration(Node subject) {
        return hasAdditionalConfiguration(subject, Node.ANY);
    }

    public static Triple hasAdditionalConfiguration(Node subject, Node object) {
        return Triple.create(subject, VonSteuben.hasAdditionalConfiguration.asNode(), object);
    }

    public static Triple job() {
        return job(Node.ANY);
    }

    public static Triple job(Node subject) {
        return Triple.create(subject, RDF.type.asNode(), VonSteuben.Job.asNode());
    }

    public static Triple resourceURI() {
        return resourceURI(Node.ANY);
    }

    public static Triple resourceURI(Node subject) {
        return Triple.create(subject, RDF.type.asNode(), VonSteuben.ResourceURI.asNode());
    }

    public static Triple workflow(Node subject) {
        return Triple.create(subject, RDF.type.asNode(), VonSteuben.Workflow.asNode());
    }

    public static Triple workflow() {
        return workflow(Node.ANY);
    }

    public static Triple hdfs() {
        return hdfs(Node.ANY);
    }

    public static Triple hdfs(Node subject) {
        return Triple.create(subject, RDF.type.asNode(), VonSteuben.HDFS.asNode());
    }

    public static Triple hasCmd() {
        return hasCmd(Node.ANY, Node.ANY);
    }

    public static Triple hasCmd(Node subject) {
        return hasCmd(subject, Node.ANY);
    }

    public static Triple hasCmd(Node subject, Node object) {
        return Triple.create(subject, VonSteuben.hasCmd.asNode(), object);
    }
}

/*
 * Copyright 2009 Brian Mackay brianwmackay@msn.com
 * All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the 'License');
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an 'AS IS' BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */